package com.day23.Stream;

import java.util.ArrayList;
import java.util.stream.Stream;
public class StreamDemo03 {
    public static void main(String[] args) {
        ArrayList<String> list = new ArrayList<String>();
        list.add("张三");
        list.add("李四");
        list.add("王五");
        list.add("赵六");
        list.add("田七");
        Stream<String> s1= list.stream().limit(4);
        Stream<String> s2 = list.stream().skip(2);
        Stream.concat(s1,s2).distinct().forEach(System.out::println);
    }
}
